<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Channel9Kinect" xmlns:layoutToolkit="clr-namespace:System.Windows.Controls" xmlns:slea="clr-namespace:Channel9Kinect.SLExtensions.Controls.Animation">

	<Style x:Key="HorizontalPagingTransitioningContentControlStyle" TargetType="{x:Type layoutToolkit:TransitioningContentControl}">
		<Setter Property="IsTabStop" Value="True" />
		<Setter Property="HorizontalContentAlignment" Value="Stretch" />
		<Setter Property="VerticalContentAlignment" Value="Stretch" />
		<Setter Property="Transition" Value="PageNext" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type layoutToolkit:TransitioningContentControl}">
					<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="2">

						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="PresentationStates">
								<VisualState x:Name="Normal">
									<Storyboard>

										<ObjectAnimationUsingKeyFrames BeginTime="00:00:00.0" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="PreviousContentPresentationSite">
											<DiscreteObjectKeyFrame KeyTime="00:00:00">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Collapsed</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
										<DoubleAnimation Duration="00:00:00" To="0" Storyboard.TargetProperty="(slea:TranslateWrapper.TranslatePercentX)" Storyboard.TargetName="CurrentContentPresentationSite" />
									</Storyboard>
								</VisualState>
								<VisualState x:Name="PageNext">
									<Storyboard>
										<DoubleAnimation Duration="00:00:00.5" BeginTime="00:00:00.0" From="1" To="0" Storyboard.TargetProperty="(slea:TranslateWrapper.TranslatePercentX)" Storyboard.TargetName="CurrentContentPresentationSite">
											<DoubleAnimation.EasingFunction>
												<CircleEase EasingMode="EaseOut" />
											</DoubleAnimation.EasingFunction>
										</DoubleAnimation>
										<DoubleAnimation Duration="00:00:00.5" BeginTime="00:00:00.0" From="0" To="-1" Storyboard.TargetProperty="(slea:TranslateWrapper.TranslatePercentX)" Storyboard.TargetName="PreviousContentPresentationSite">
											<DoubleAnimation.EasingFunction>
												<CircleEase EasingMode="EaseOut" />
											</DoubleAnimation.EasingFunction>
										</DoubleAnimation>
										<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="PreviousContentPresentationSite">
											<DiscreteObjectKeyFrame KeyTime="00:00:00">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="PagePrevious">
									<Storyboard>
										<DoubleAnimation Duration="00:00:00.5" BeginTime="00:00:00.0" From="-1" To="0" Storyboard.TargetProperty="(slea:TranslateWrapper.TranslatePercentX)" Storyboard.TargetName="CurrentContentPresentationSite">
											<DoubleAnimation.EasingFunction>
												<CircleEase EasingMode="EaseOut" />
											</DoubleAnimation.EasingFunction>
										</DoubleAnimation>
										<DoubleAnimation Duration="00:00:00.5" BeginTime="00:00:00.0" From="0" To="1" Storyboard.TargetProperty="(slea:TranslateWrapper.TranslatePercentX)" Storyboard.TargetName="PreviousContentPresentationSite">
											<DoubleAnimation.EasingFunction>
												<CircleEase EasingMode="EaseOut" />
											</DoubleAnimation.EasingFunction>
										</DoubleAnimation>
										<ObjectAnimationUsingKeyFrames BeginTime="00:00:00.0" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="PreviousContentPresentationSite">
											<DiscreteObjectKeyFrame KeyTime="00:00:00">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="DefaultTransition">
									<Storyboard>
										<DoubleAnimation Duration="00:00:00" BeginTime="00:00:00.0" From="0" To="0" Storyboard.TargetProperty="(slea:TranslateWrapper.TranslatePercentX)" Storyboard.TargetName="CurrentContentPresentationSite">
											<DoubleAnimation.EasingFunction>
												<CircleEase EasingMode="EaseOut" />
											</DoubleAnimation.EasingFunction>
										</DoubleAnimation>
										<DoubleAnimation Duration="00:00:00" BeginTime="00:00:00.0" From="0" To="0" Storyboard.TargetProperty="(slea:TranslateWrapper.TranslatePercentX)" Storyboard.TargetName="PreviousContentPresentationSite">
											<DoubleAnimation.EasingFunction>
												<CircleEase EasingMode="EaseOut" />
											</DoubleAnimation.EasingFunction>
										</DoubleAnimation>
										<ObjectAnimationUsingKeyFrames BeginTime="00:00:00.0" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="PreviousContentPresentationSite">
											<DiscreteObjectKeyFrame KeyTime="00:00:00">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
										<DoubleAnimation Duration="00:00:00.5" BeginTime="00:00:00.0" From="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CurrentContentPresentationSite">
											<DoubleAnimation.EasingFunction>
												<CircleEase EasingMode="EaseOut" />
											</DoubleAnimation.EasingFunction>
										</DoubleAnimation>
										<DoubleAnimation Duration="00:00:00.5" BeginTime="00:00:00.0" From="1" To="0" Storyboard.TargetProperty="Opactity" Storyboard.TargetName="PreviousContentPresentationSite">
											<DoubleAnimation.EasingFunction>
												<CircleEase EasingMode="EaseOut" />
											</DoubleAnimation.EasingFunction>
										</DoubleAnimation>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Grid ClipToBounds="True">
							<ContentPresenter x:Name="PreviousContentPresentationSite" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{x:Null}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
								<ContentPresenter.RenderTransform>
									<TransformGroup>
										<ScaleTransform />
										<SkewTransform />
										<RotateTransform />
										<TranslateTransform />
									</TransformGroup>
								</ContentPresenter.RenderTransform>
							</ContentPresenter>
							<ContentPresenter x:Name="CurrentContentPresentationSite" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{x:Null}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" slea:TranslateWrapper.TranslatePercentX="1">
								<ContentPresenter.RenderTransform>
									<TransformGroup>
										<ScaleTransform />
										<SkewTransform />
										<RotateTransform />
										<TranslateTransform />
									</TransformGroup>
								</ContentPresenter.RenderTransform>
							</ContentPresenter>
						</Grid>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style TargetType="{x:Type layoutToolkit:TransitioningContentControl}">
		<Setter Property="IsTabStop" Value="True" />
		<Setter Property="HorizontalContentAlignment" Value="Left" />
		<Setter Property="VerticalContentAlignment" Value="Top" />
		<Setter Property="Transition" Value="DefaultTransition" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type layoutToolkit:TransitioningContentControl}">
					<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="PresentationStates">
								<VisualState x:Name="DefaultTransition">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CurrentContentPresentationSite" Storyboard.TargetProperty="(UIElement.Opacity)">
											<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
											<SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="1" />
										</DoubleAnimationUsingKeyFrames>
										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentPresentationSite" Storyboard.TargetProperty="(UIElement.Opacity)">
											<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
											<SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="0" />
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Normal">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentPresentationSite" Storyboard.TargetProperty="(UIElement.Visibility)">
											<DiscreteObjectKeyFrame KeyTime="00:00:00">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Collapsed</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>

								<VisualState x:Name="UpTransition">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CurrentContentPresentationSite" Storyboard.TargetProperty="(UIElement.Opacity)">
											<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
											<SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="1" />
										</DoubleAnimationUsingKeyFrames>

										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CurrentContentPresentationSite" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
											<SplineDoubleKeyFrame KeyTime="00:00:00" Value="30" />
											<SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="0" />
										</DoubleAnimationUsingKeyFrames>

										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentPresentationSite" Storyboard.TargetProperty="(UIElement.Opacity)">
											<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
											<SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="0" />
										</DoubleAnimationUsingKeyFrames>

										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentPresentationSite" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
											<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
											<SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="-30" />
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>

								<VisualState x:Name="DownTransition">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CurrentContentPresentationSite" Storyboard.TargetProperty="(UIElement.Opacity)">
											<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
											<SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="1" />
										</DoubleAnimationUsingKeyFrames>

										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CurrentContentPresentationSite" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
											<SplineDoubleKeyFrame KeyTime="00:00:00" Value="-40" />
											<SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="0" />
										</DoubleAnimationUsingKeyFrames>

										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentPresentationSite" Storyboard.TargetProperty="(UIElement.Opacity)">
											<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
											<SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="0" />
										</DoubleAnimationUsingKeyFrames>

										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentPresentationSite" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
											<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
											<SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="40" />
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>

							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>

						<Grid>
							<ContentPresenter x:Name="PreviousContentPresentationSite" Content="{x:Null}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
								<ContentPresenter.RenderTransform>
									<TransformGroup>
										<ScaleTransform />
										<SkewTransform />
										<RotateTransform />
										<TranslateTransform />
									</TransformGroup>
								</ContentPresenter.RenderTransform>
							</ContentPresenter>

							<ContentPresenter x:Name="CurrentContentPresentationSite" Content="{x:Null}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
								<ContentPresenter.RenderTransform>
									<TransformGroup>
										<ScaleTransform />
										<SkewTransform />
										<RotateTransform />
										<TranslateTransform />
									</TransformGroup>
								</ContentPresenter.RenderTransform>
							</ContentPresenter>
						</Grid>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style TargetType="{x:Type local:PagedGrid}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:PagedGrid}">
					<Grid x:Name="LayoutRoot" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}">
						<Grid ClipToBounds="True">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="57.5" />
								<ColumnDefinition />
								<ColumnDefinition Width="57.5" />
							</Grid.ColumnDefinitions>

							<Grid Grid.Column="1" x:Name="grid">

								<layoutToolkit:TransitioningContentControl Style="{StaticResource HorizontalPagingTransitioningContentControlStyle}" Transition="{Binding Transition}" Content="{Binding PagedCollection.Page}">
									<layoutToolkit:TransitioningContentControl.ContentTemplate>
										<DataTemplate>
											<Grid>
												<ItemsControl ItemsSource="{Binding}">
												</ItemsControl>
											</Grid>
										</DataTemplate>
									</layoutToolkit:TransitioningContentControl.ContentTemplate>
								</layoutToolkit:TransitioningContentControl>
							</Grid>
							<Button Grid.Column="0" Opacity="0.63" Margin="0,0,7,0" Command="{Binding PagePrevious}" Foreground="#3B3835" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Cursor="Hand">
								<Button.ContentTemplate>
									<DataTemplate>
										<Canvas Background="Transparent" Width="50" Height="50">
											<Path Width="50" Height="50" Stretch="Fill" Fill="White" Data="F1 M 558.253,478.75L 546.25,466.747L 558.747,454.25L 561.075,456.578L 550.906,466.747L 560.581,476.422L 558.253,478.75M 576.5,441.5L 532.5,441.5C 530.843,441.5 529.5,442.843 529.5,444.5L 529.5,488.5C 529.5,490.157 530.843,491.5 532.5,491.5L 576.5,491.5C 578.157,491.5 579.5,490.157 579.5,488.5L 579.5,444.5C 579.5,442.843 578.157,441.5 576.5,441.5" />
										</Canvas>
									</DataTemplate>
								</Button.ContentTemplate>
							</Button>

							<Button Grid.Column="2" Opacity="0.63" Margin="7,0,0,0" Command="{Binding PageNext}" Foreground="#3B3835" FontSize="18" Cursor="Hand">
								<Button.ContentTemplate>
									<DataTemplate>
										<Canvas Background="Transparent" Width="50" Height="50">
											<Path Width="50" Height="50" Stretch="Fill" Fill="White" Data="F1 M 558.253,478.75L 546.25,466.747L 558.747,454.25L 561.075,456.578L 550.906,466.747L 560.581,476.422L 558.253,478.75M 576.5,441.5L 532.5,441.5C 530.843,441.5 529.5,442.843 529.5,444.5L 529.5,488.5C 529.5,490.157 530.843,491.5 532.5,491.5L 576.5,491.5C 578.157,491.5 579.5,490.157 579.5,488.5L 579.5,444.5C 579.5,442.843 578.157,441.5 576.5,441.5" RenderTransformOrigin="0.5,0.5">
												<Path.RenderTransform>
													<ScaleTransform ScaleX="-1" />
												</Path.RenderTransform>
											</Path>
										</Canvas>
									</DataTemplate>
								</Button.ContentTemplate>
							</Button>
						</Grid>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>